import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue'
const path = require('path')
// https://vitejs.dev/config/
export default defineConfig({
	plugins: [vue()],
	envDir: path.resolve(__dirname, './env'),
	server: {
		host: true,
		port: 3000,
		open: false
	},
	alias: {
		'@': path.resolve(__dirname, './src')
	},
	hostname: '0.0.0.0',//允许本机
    port: 3000,//设置端口
    // 反向代理
    proxy: {
      '/': {
        target: 'https://www.cdsp.org.cn/',
        ws: true, // 需要websocket 开启
        pathRewrite: {
          '^/': '/'
        }
      }
    }
})
